using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Text;

namespace Data_Access_Tier
{
	public class HRM_INSURANCE_TABLELISTData : DatabaseObjectBase
	{
		public HRM_INSURANCE_TABLELISTData()
		{
			Initialize(true);
		}
		public HRM_INSURANCE_TABLELISTData(Boolean newConnection)
		{
			Initialize(newConnection);
		}

		public Int32 HRM_INSURANCE_TABLELIST_Insert(Guid InsuranceTableListID, String InsuranceTableListName, Int32 Month, Int32 Year, Int32 Course, Boolean IsBegin, Double SocialInsurance, Double HealthInsurance, Double UnemploymentInsurance, Decimal MinimumSalary, Decimal MaximumInsurance, Int32 QuantitySocialInsurance, Int32 QuantityHealthInsurance, Int32 QuantityUnemploymentInsurance, Decimal WageSocialInsurance, Decimal WageHealthInsurance, Decimal WageUnemploymentInsurance, Decimal SendSocialInsurance, Decimal SendHealthInsurance, Decimal SendUnemploymentInsurance, String Description)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.InsertCommand = new SqlCommand("HRM_INSURANCE_TABLELIST_Insert");
				_dbadapter.InsertCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.InsertCommand.Connection = _dbconn;
				_trans = _dbconn.BeginTransaction();
				_dbadapter.InsertCommand.Transaction = _trans;
				_dbadapter.InsertCommand.Parameters.Clear();
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@InsuranceTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@InsuranceTableListName", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Month", SqlDbType.Int));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Year", SqlDbType.Int));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Course", SqlDbType.Int));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@IsBegin", SqlDbType.Bit));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@SocialInsurance", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@HealthInsurance", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@UnemploymentInsurance", SqlDbType.Float));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@MinimumSalary", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@MaximumInsurance", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@QuantitySocialInsurance", SqlDbType.Int));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@QuantityHealthInsurance", SqlDbType.Int));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@QuantityUnemploymentInsurance", SqlDbType.Int));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@WageSocialInsurance", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@WageHealthInsurance", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@WageUnemploymentInsurance", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@SendSocialInsurance", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@SendHealthInsurance", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@SendUnemploymentInsurance", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Description", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Prepare();
				SqlGuid InsuranceTableListIDSQL = InsuranceTableListID;
				_dbadapter.InsertCommand.Parameters["@InsuranceTableListID"].Value = InsuranceTableListIDSQL;
				SqlString InsuranceTableListNameSQL = InsuranceTableListName;
				_dbadapter.InsertCommand.Parameters["@InsuranceTableListName"].Value = InsuranceTableListNameSQL;
				SqlInt32 MonthSQL = Month;
				_dbadapter.InsertCommand.Parameters["@Month"].Value = MonthSQL;
				SqlInt32 YearSQL = Year;
				_dbadapter.InsertCommand.Parameters["@Year"].Value = YearSQL;
				SqlInt32 CourseSQL = Course;
				_dbadapter.InsertCommand.Parameters["@Course"].Value = CourseSQL;
				SqlBoolean IsBeginSQL = IsBegin;
				_dbadapter.InsertCommand.Parameters["@IsBegin"].Value = IsBeginSQL;
				SqlDouble SocialInsuranceSQL = SocialInsurance;
				_dbadapter.InsertCommand.Parameters["@SocialInsurance"].Value = SocialInsuranceSQL;
				SqlDouble HealthInsuranceSQL = HealthInsurance;
				_dbadapter.InsertCommand.Parameters["@HealthInsurance"].Value = HealthInsuranceSQL;
				SqlDouble UnemploymentInsuranceSQL = UnemploymentInsurance;
				_dbadapter.InsertCommand.Parameters["@UnemploymentInsurance"].Value = UnemploymentInsuranceSQL;
				SqlMoney MinimumSalarySQL = MinimumSalary;
				_dbadapter.InsertCommand.Parameters["@MinimumSalary"].Value = MinimumSalarySQL;
				SqlMoney MaximumInsuranceSQL = MaximumInsurance;
				_dbadapter.InsertCommand.Parameters["@MaximumInsurance"].Value = MaximumInsuranceSQL;
				SqlInt32 QuantitySocialInsuranceSQL = QuantitySocialInsurance;
				_dbadapter.InsertCommand.Parameters["@QuantitySocialInsurance"].Value = QuantitySocialInsuranceSQL;
				SqlInt32 QuantityHealthInsuranceSQL = QuantityHealthInsurance;
				_dbadapter.InsertCommand.Parameters["@QuantityHealthInsurance"].Value = QuantityHealthInsuranceSQL;
				SqlInt32 QuantityUnemploymentInsuranceSQL = QuantityUnemploymentInsurance;
				_dbadapter.InsertCommand.Parameters["@QuantityUnemploymentInsurance"].Value = QuantityUnemploymentInsuranceSQL;
				SqlMoney WageSocialInsuranceSQL = WageSocialInsurance;
				_dbadapter.InsertCommand.Parameters["@WageSocialInsurance"].Value = WageSocialInsuranceSQL;
				SqlMoney WageHealthInsuranceSQL = WageHealthInsurance;
				_dbadapter.InsertCommand.Parameters["@WageHealthInsurance"].Value = WageHealthInsuranceSQL;
				SqlMoney WageUnemploymentInsuranceSQL = WageUnemploymentInsurance;
				_dbadapter.InsertCommand.Parameters["@WageUnemploymentInsurance"].Value = WageUnemploymentInsuranceSQL;
				SqlMoney SendSocialInsuranceSQL = SendSocialInsurance;
				_dbadapter.InsertCommand.Parameters["@SendSocialInsurance"].Value = SendSocialInsuranceSQL;
				SqlMoney SendHealthInsuranceSQL = SendHealthInsurance;
				_dbadapter.InsertCommand.Parameters["@SendHealthInsurance"].Value = SendHealthInsuranceSQL;
				SqlMoney SendUnemploymentInsuranceSQL = SendUnemploymentInsurance;
				_dbadapter.InsertCommand.Parameters["@SendUnemploymentInsurance"].Value = SendUnemploymentInsuranceSQL;
				SqlString DescriptionSQL = Description;
				_dbadapter.InsertCommand.Parameters["@Description"].Value = DescriptionSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.InsertCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_INSURANCE_TABLELIST_Insert: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_INSURANCE_TABLELIST_Insert: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.InsertCommand != null)
					_dbadapter.InsertCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_INSURANCE_TABLELIST_Update(Guid InsuranceTableListID, String InsuranceTableListName, Int32 Month, Int32 Year, Int32 Course, Boolean IsBegin, Double SocialInsurance, Double HealthInsurance, Double UnemploymentInsurance, Decimal MinimumSalary, Decimal MaximumInsurance, Int32 QuantitySocialInsurance, Int32 QuantityHealthInsurance, Int32 QuantityUnemploymentInsurance, Decimal WageSocialInsurance, Decimal WageHealthInsurance, Decimal WageUnemploymentInsurance, Decimal SendSocialInsurance, Decimal SendHealthInsurance, Decimal SendUnemploymentInsurance, String Description)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_INSURANCE_TABLELIST_Update");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@InsuranceTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@InsuranceTableListName", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Month", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Year", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Course", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@IsBegin", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SocialInsurance", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@HealthInsurance", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@UnemploymentInsurance", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MinimumSalary", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MaximumInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@QuantitySocialInsurance", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@QuantityHealthInsurance", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@QuantityUnemploymentInsurance", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@WageSocialInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@WageHealthInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@WageUnemploymentInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SendSocialInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SendHealthInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SendUnemploymentInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Description", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid InsuranceTableListIDSQL = InsuranceTableListID;
				_dbadapter.UpdateCommand.Parameters["@InsuranceTableListID"].Value = InsuranceTableListIDSQL;
				SqlString InsuranceTableListNameSQL = InsuranceTableListName;
				_dbadapter.UpdateCommand.Parameters["@InsuranceTableListName"].Value = InsuranceTableListNameSQL;
				SqlInt32 MonthSQL = Month;
				_dbadapter.UpdateCommand.Parameters["@Month"].Value = MonthSQL;
				SqlInt32 YearSQL = Year;
				_dbadapter.UpdateCommand.Parameters["@Year"].Value = YearSQL;
				SqlInt32 CourseSQL = Course;
				_dbadapter.UpdateCommand.Parameters["@Course"].Value = CourseSQL;
				SqlBoolean IsBeginSQL = IsBegin;
				_dbadapter.UpdateCommand.Parameters["@IsBegin"].Value = IsBeginSQL;
				SqlDouble SocialInsuranceSQL = SocialInsurance;
				_dbadapter.UpdateCommand.Parameters["@SocialInsurance"].Value = SocialInsuranceSQL;
				SqlDouble HealthInsuranceSQL = HealthInsurance;
				_dbadapter.UpdateCommand.Parameters["@HealthInsurance"].Value = HealthInsuranceSQL;
				SqlDouble UnemploymentInsuranceSQL = UnemploymentInsurance;
				_dbadapter.UpdateCommand.Parameters["@UnemploymentInsurance"].Value = UnemploymentInsuranceSQL;
				SqlMoney MinimumSalarySQL = MinimumSalary;
				_dbadapter.UpdateCommand.Parameters["@MinimumSalary"].Value = MinimumSalarySQL;
				SqlMoney MaximumInsuranceSQL = MaximumInsurance;
				_dbadapter.UpdateCommand.Parameters["@MaximumInsurance"].Value = MaximumInsuranceSQL;
				SqlInt32 QuantitySocialInsuranceSQL = QuantitySocialInsurance;
				_dbadapter.UpdateCommand.Parameters["@QuantitySocialInsurance"].Value = QuantitySocialInsuranceSQL;
				SqlInt32 QuantityHealthInsuranceSQL = QuantityHealthInsurance;
				_dbadapter.UpdateCommand.Parameters["@QuantityHealthInsurance"].Value = QuantityHealthInsuranceSQL;
				SqlInt32 QuantityUnemploymentInsuranceSQL = QuantityUnemploymentInsurance;
				_dbadapter.UpdateCommand.Parameters["@QuantityUnemploymentInsurance"].Value = QuantityUnemploymentInsuranceSQL;
				SqlMoney WageSocialInsuranceSQL = WageSocialInsurance;
				_dbadapter.UpdateCommand.Parameters["@WageSocialInsurance"].Value = WageSocialInsuranceSQL;
				SqlMoney WageHealthInsuranceSQL = WageHealthInsurance;
				_dbadapter.UpdateCommand.Parameters["@WageHealthInsurance"].Value = WageHealthInsuranceSQL;
				SqlMoney WageUnemploymentInsuranceSQL = WageUnemploymentInsurance;
				_dbadapter.UpdateCommand.Parameters["@WageUnemploymentInsurance"].Value = WageUnemploymentInsuranceSQL;
				SqlMoney SendSocialInsuranceSQL = SendSocialInsurance;
				_dbadapter.UpdateCommand.Parameters["@SendSocialInsurance"].Value = SendSocialInsuranceSQL;
				SqlMoney SendHealthInsuranceSQL = SendHealthInsurance;
				_dbadapter.UpdateCommand.Parameters["@SendHealthInsurance"].Value = SendHealthInsuranceSQL;
				SqlMoney SendUnemploymentInsuranceSQL = SendUnemploymentInsurance;
				_dbadapter.UpdateCommand.Parameters["@SendUnemploymentInsurance"].Value = SendUnemploymentInsuranceSQL;
				SqlString DescriptionSQL = Description;
				_dbadapter.UpdateCommand.Parameters["@Description"].Value = DescriptionSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_INSURANCE_TABLELIST_Update: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_INSURANCE_TABLELIST_Update: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_INSURANCE_TABLELIST_Disable(Guid InsuranceTableListID, ref Boolean Enabled)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_INSURANCE_TABLELIST_Disable");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@InsuranceTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@enabled", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid InsuranceTableListIDSQL = InsuranceTableListID;
				_dbadapter.UpdateCommand.Parameters["@InsuranceTableListID"].Value = InsuranceTableListIDSQL;
				_dbadapter.UpdateCommand.Parameters["@enabled"].Direction = ParameterDirection.Output;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_INSURANCE_TABLELIST_Disable: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_INSURANCE_TABLELIST_Disable: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_INSURANCE_TABLELIST_Delete(Guid InsuranceTableListID)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.DeleteCommand = new SqlCommand("HRM_INSURANCE_TABLELIST_Delete");
				_dbadapter.DeleteCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.DeleteCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.DeleteCommand.Transaction = _trans;

				_dbadapter.DeleteCommand.Parameters.Clear();
				_dbadapter.DeleteCommand.Parameters.Add(new SqlParameter("@InsuranceTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.DeleteCommand.Prepare();
				SqlGuid InsuranceTableListIDSQL = InsuranceTableListID;
				_dbadapter.DeleteCommand.Parameters["@InsuranceTableListID"].Value = InsuranceTableListIDSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.DeleteCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_INSURANCE_TABLELIST_Delete: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_INSURANCE_TABLELIST_Delete: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.DeleteCommand != null)
					_dbadapter.DeleteCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_INSURANCE_TABLELIST_Save(Guid InsuranceTableListID, String InsuranceTableListName, Int32 Month, Int32 Year, Int32 Course, Boolean IsBegin, Double SocialInsurance, Double HealthInsurance, Double UnemploymentInsurance, Decimal MinimumSalary, Decimal MaximumInsurance, Int32 QuantitySocialInsurance, Int32 QuantityHealthInsurance, Int32 QuantityUnemploymentInsurance, Decimal WageSocialInsurance, Decimal WageHealthInsurance, Decimal WageUnemploymentInsurance, Decimal SendSocialInsurance, Decimal SendHealthInsurance, Decimal SendUnemploymentInsurance, String Description)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_INSURANCE_TABLELIST_Save");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@InsuranceTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@InsuranceTableListName", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Month", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Year", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Course", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@IsBegin", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SocialInsurance", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@HealthInsurance", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@UnemploymentInsurance", SqlDbType.Float));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MinimumSalary", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MaximumInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@QuantitySocialInsurance", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@QuantityHealthInsurance", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@QuantityUnemploymentInsurance", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@WageSocialInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@WageHealthInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@WageUnemploymentInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SendSocialInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SendHealthInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@SendUnemploymentInsurance", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Description", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Prepare();
				SqlGuid InsuranceTableListIDSQL = InsuranceTableListID;
				_dbadapter.UpdateCommand.Parameters["@InsuranceTableListID"].Value = InsuranceTableListIDSQL;
				SqlString InsuranceTableListNameSQL = InsuranceTableListName;
				_dbadapter.UpdateCommand.Parameters["@InsuranceTableListName"].Value = InsuranceTableListNameSQL;
				SqlInt32 MonthSQL = Month;
				_dbadapter.UpdateCommand.Parameters["@Month"].Value = MonthSQL;
				SqlInt32 YearSQL = Year;
				_dbadapter.UpdateCommand.Parameters["@Year"].Value = YearSQL;
				SqlInt32 CourseSQL = Course;
				_dbadapter.UpdateCommand.Parameters["@Course"].Value = CourseSQL;
				SqlBoolean IsBeginSQL = IsBegin;
				_dbadapter.UpdateCommand.Parameters["@IsBegin"].Value = IsBeginSQL;
				SqlDouble SocialInsuranceSQL = SocialInsurance;
				_dbadapter.UpdateCommand.Parameters["@SocialInsurance"].Value = SocialInsuranceSQL;
				SqlDouble HealthInsuranceSQL = HealthInsurance;
				_dbadapter.UpdateCommand.Parameters["@HealthInsurance"].Value = HealthInsuranceSQL;
				SqlDouble UnemploymentInsuranceSQL = UnemploymentInsurance;
				_dbadapter.UpdateCommand.Parameters["@UnemploymentInsurance"].Value = UnemploymentInsuranceSQL;
				SqlMoney MinimumSalarySQL = MinimumSalary;
				_dbadapter.UpdateCommand.Parameters["@MinimumSalary"].Value = MinimumSalarySQL;
				SqlMoney MaximumInsuranceSQL = MaximumInsurance;
				_dbadapter.UpdateCommand.Parameters["@MaximumInsurance"].Value = MaximumInsuranceSQL;
				SqlInt32 QuantitySocialInsuranceSQL = QuantitySocialInsurance;
				_dbadapter.UpdateCommand.Parameters["@QuantitySocialInsurance"].Value = QuantitySocialInsuranceSQL;
				SqlInt32 QuantityHealthInsuranceSQL = QuantityHealthInsurance;
				_dbadapter.UpdateCommand.Parameters["@QuantityHealthInsurance"].Value = QuantityHealthInsuranceSQL;
				SqlInt32 QuantityUnemploymentInsuranceSQL = QuantityUnemploymentInsurance;
				_dbadapter.UpdateCommand.Parameters["@QuantityUnemploymentInsurance"].Value = QuantityUnemploymentInsuranceSQL;
				SqlMoney WageSocialInsuranceSQL = WageSocialInsurance;
				_dbadapter.UpdateCommand.Parameters["@WageSocialInsurance"].Value = WageSocialInsuranceSQL;
				SqlMoney WageHealthInsuranceSQL = WageHealthInsurance;
				_dbadapter.UpdateCommand.Parameters["@WageHealthInsurance"].Value = WageHealthInsuranceSQL;
				SqlMoney WageUnemploymentInsuranceSQL = WageUnemploymentInsurance;
				_dbadapter.UpdateCommand.Parameters["@WageUnemploymentInsurance"].Value = WageUnemploymentInsuranceSQL;
				SqlMoney SendSocialInsuranceSQL = SendSocialInsurance;
				_dbadapter.UpdateCommand.Parameters["@SendSocialInsurance"].Value = SendSocialInsuranceSQL;
				SqlMoney SendHealthInsuranceSQL = SendHealthInsurance;
				_dbadapter.UpdateCommand.Parameters["@SendHealthInsurance"].Value = SendHealthInsuranceSQL;
				SqlMoney SendUnemploymentInsuranceSQL = SendUnemploymentInsurance;
				_dbadapter.UpdateCommand.Parameters["@SendUnemploymentInsurance"].Value = SendUnemploymentInsuranceSQL;
				SqlString DescriptionSQL = Description;
				_dbadapter.UpdateCommand.Parameters["@Description"].Value = DescriptionSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_INSURANCE_TABLELIST_Save: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_INSURANCE_TABLELIST_Save: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet HRM_INSURANCE_TABLELIST_GetList()
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("HRM_INSURANCE_TABLELIST_GetList");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Prepare();
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: HRM_INSURANCE_TABLELIST_GetList: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet HRM_INSURANCE_TABLELIST_Get(Guid InsuranceTableListID)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("HRM_INSURANCE_TABLELIST_Get");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Parameters.Add(new SqlParameter("@InsuranceTableListID", SqlDbType.UniqueIdentifier));
				_dbadapter.SelectCommand.Prepare();
				SqlGuid InsuranceTableListIDSQL = InsuranceTableListID;
				_dbadapter.SelectCommand.Parameters["@InsuranceTableListID"].Value = InsuranceTableListIDSQL;
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: HRM_INSURANCE_TABLELIST_Get: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}

        public DataSet HRM_INSURANCE_GetListByInsuranceTableList(Guid InsuranceTableListID)
        {
            try
            {
                if (_dbconn.State != ConnectionState.Open)
                    _dbconn.Open();
                _dbadapter.SelectCommand = new SqlCommand("HRM_INSURANCE_GetListByInsuranceTableList");
                _dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
                _dbadapter.SelectCommand.Connection = _dbconn;
                _dbadapter.SelectCommand.Parameters.Clear();
                _dbadapter.SelectCommand.Parameters.Add(new SqlParameter("@InsuranceTableListID", SqlDbType.UniqueIdentifier));
                _dbadapter.SelectCommand.Prepare();
                SqlGuid InsuranceTableListIDSQL = InsuranceTableListID;
                _dbadapter.SelectCommand.Parameters["@InsuranceTableListID"].Value = InsuranceTableListIDSQL;
                _dbadapter.Fill(_data);

                return _data;
            }
            catch (SqlException e)
            {
                throw new Exception("SQL Error: HRM_INSURANCE_GetListByInsuranceTableList: " + e.Message, e);
            }
            finally
            {
                if (_dbadapter.SelectCommand != null)
                    _dbadapter.SelectCommand.Dispose();
                CloseConnection();
            }
        }
    }
}
